$(function () {
    var sum =0;
    var colors = Highcharts.getOptions().colors,
        categories = ['LGC', 'ESC', 'ASC', 'ASD', 'DMS1', 'DMS2'],
        data = [{
                y: 32,
                color: colors[0]
            }, {
                y: 14,
                color: colors[1]
            }, {
                y: 11,
                color: colors[2]
            }, {
                y: 8,
                color: colors[3]
            }, {
                y: 5,
                color: colors[4]
            }, {
                y: 6,
                color: colors[5]
            }];


    // Build the data arrays
    var browserData = [];
    for (var i = 0; i < data.length; i++) {

        // add browser data
        browserData.push({
            name: categories[i],
            y: data[i].y,
            color: data[i].color
        });
        sum += data[i].y;
    }

    // Create the chart
    $('#chart2_2').highcharts({
        chart: {
            type: 'pie'
        },
        title: {
            text: '센터 유형'
        },
        legend: {
            align: 'right',
            x: -20,
            y: 80,
            verticalAlign: 'top',
            backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
            borderColor: '#CCC',
            borderWidth: 1,
            floating: true,
            layout: 'vertical'
        },
        yAxis: {
            title: {
                text: 'Total percent market share'
            }
        },
        plotOptions: {
            pie: {
                shadow: false,
                center: ['50%', '50%'],
                showInLegend: true,
            }
        },
        tooltip: {
    	    valueSuffix: ''
        },
        series: [{
            name: '유형 건수',
            data: browserData,
            size: '70%',
            innerSize: '30%',
            dataLabels: {
                formatter: function() {
                    return this.y > 2 ? this.point.name : null;
                },
                color: 'white',
                distance: -27,
                style : {
                	fontSize: '17px'
                }
            }
        }]
    });
});